/*
 * @Description:
 * @Autor: zzj
 * @Date: 2023-08-27 15:22:10
 * @LastEditors: zzj
 * @LastEditTime: 2023-08-29 13:04:24
 * @FilePath: \vite-project\src\components\index.ts
 */
// 引入全部组件
import SvgIcon from './SvgIcon/index.vue'
import Pagination from './Pagination/index.vue'
const allGloablComponent: { [key: string]: Object } = { SvgIcon, Pagination }
export default {
  install(app: any) {
    // 注册项目全部的全局组件
    Object.keys(allGloablComponent).forEach((key) => {
      app.component(key, allGloablComponent[key])
      // 解决爆红，两种方法都ok
      // app.component(key,allGloablComponent[key as keyof typeof allGloablComponent])
    })
  },
}
